home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / dev / lang / sbp3_1e.lzh / MDC.PL < prev    next >
Text File  |  1991-10-31  |  4KB  |  146 lines

  1. /* From the book PROLOG PROGRAMMING IN DEPTH
  2.    by Michael A. Covington, Donald Nute, and Andre Vellino.
  3.    Copyright 1988 Scott, Foresman & Co.
  4.    Non-commercial distribution of this file is permitted. */
  5. /* Modified for Quintus Prolog by Andreas Siebert */
  6.  
  7. /* MDC.PL  */
  8.  
  9. /*
  10.  * Contains a CONMAN knowledge base.
  11.  * Requires all utility procedures defined in file CONMAN.PL.
  12.  */
  13.  
  14. :- ( clause(conman,_) ; consult('conman.pl') ).
  15.  
  16. /*
  17.  * Any previously defined clauses for the predicates KB_INTRO,
  18.  * KB_THRESHOLD, KB_HYPOTHESIS, C_RULE, and KB_CAN_ASK should
  19.  * be removed from the knowledge base before loading the
  20.  * clauses below.
  21.  */
  22.  
  23. :- abolish(kb_intro,1).
  24. :- abolish(kb_threshold,1).
  25. :- abolish(kb_hypothesis,1). 
  26. :- abolish(c_rule,4).     
  27. :- abolish(kb_can_ask,1).   
  28.  
  29. kb_intro(
  30.      ['',
  31.       'MDC: A Demonstration Medical Diagnostic System',
  32.       '           Using Confidence Rules',
  33.       '']).
  34.  
  35. kb_threshold(65).
  36.  
  37. kb_hypothesis('The patient has allergic rhinitis.').
  38. kb_hypothesis('The patient has strep throat.').
  39. kb_hypothesis('The patient has pneumonia.').
  40. kb_hypothesis('Give the patient an antihistamine.').
  41. kb_hypothesis('Give the patient a decongestant.').
  42. kb_hypothesis('Give the patient penicillin.').
  43. kb_hypothesis('Give the patient tetracycline.').
  44. kb_hypothesis('Give the patient erythromycin.').
  45.  
  46. c_rule('The patient has nasal congestion.',
  47.      95,
  48.      [],
  49.      ['The patient is breathing through the mouth.',yes]).
  50.  
  51. c_rule('The patient has a sore throat.',
  52.      95,
  53.      [],
  54.      [and,['The patient is coughing.',yes],
  55.           ['The inside of the patient''s throat is red.',
  56.                yes]]).
  57.  
  58. c_rule('The patient has a sore throat.',
  59.      90,
  60.      [],
  61.      ['The inside of the patient''s throat is red.',yes]).
  62.  
  63. c_rule('The patient has a sore throat.',
  64.      75,
  65.      [],
  66.      ['The patient is coughing.',yes]).
  67.  
  68. c_rule('The patient has chest congestion.',
  69.      100,
  70.      [],
  71.      ['There are rumbling sounds in the chest.',yes]).
  72.  
  73. c_rule('The patient has allergic rhinitis.',
  74.      85,
  75.      [],
  76.      [and,['The patient has nasal congestion.',yes],
  77.           [and,['The patient has a sore throat.',no],
  78.                ['The patient has chest congestion.',no]]]).
  79.  
  80. c_rule('The patient has strep throat.',
  81.      80,
  82.      [],
  83.      [and,['The patient has nasal congestion.',yes],
  84.           ['The patient has a sore throat.',yes]]).
  85.  
  86. c_rule('The patient has pneumonia.',
  87.      90,
  88.      [],
  89.      [and,['The patient has chest congestion.',yes],
  90.           [and,['The patient has nasal congestion.',yes],
  91.                ['The patient has a sore throat.',no]]]).
  92.  
  93. c_rule('The patient has pneumonia.',
  94.      75,
  95.      [],
  96.      [and,['The patient has chest congestion.',yes],
  97.           ['The patient has nasal congestion.',yes]]).
  98.  
  99. c_rule('Give the patient an antihistamine.',
  100.      100,
  101.      ['The patient has allergic rhinitis.'],
  102.      []).
  103.  
  104. c_rule('Give the patient a decongestant.',
  105.      100,
  106.      ['The patient has nasal congestion.'],
  107.      ['The patient has high blood pressure.',no]).
  108.  
  109. c_rule('Give the patient penicillin.',
  110.      100,
  111.      ['The patient has pneumonia.'],
  112.      ['The patient is allergic to penicillin.',no]).
  113.  
  114. c_rule('Give the patient penicillin.',
  115.      100,
  116.      ['The patient has pneumonia.',
  117.       'The patient is allergic to penicillin.'],
  118.      [and,['The patient is in critical condition.',yes],
  119.           ['The patient is allergic to tetracycline.',yes]]).
  120.  
  121. c_rule('Give the patient tetracycline.',
  122.      100,
  123.      ['The patient has pneumonia.',
  124.       -,'Give the patient penicillin.'],
  125.      ['The patient is allergic to tetracycline.',no]).
  126.  
  127. c_rule('Give the patient erythromycin.',
  128.      100,
  129.      ['The patient has strep throat.'],
  130.      ['The patient is allergic to erythromycin.',no]).
  131.  
  132. kb_can_ask('The patient has nasal congestion.').
  133. kb_can_ask('The patient has chest congestion.').
  134. kb_can_ask('The patient has a sore throat.').
  135. kb_can_ask('The patient has high blood pressure.').
  136. kb_can_ask('The patient is allergic to penicillin.').
  137. kb_can_ask('The patient is allergic to erythromycin.').
  138. kb_can_ask('The patient is allergic to tetracycline.').
  139. kb_can_ask('The patient is breathing through the mouth.').
  140. kb_can_ask('The patient is coughing.').
  141. kb_can_ask('The inside of the patient''s throat is red.').
  142. kb_can_ask('There are rumbling sounds in the chest.').
  143. kb_can_ask('The patient is in critical condition.').
  144.  
  145. :- conman.
  146.